﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DatePlan.aspx.cs" Inherits="ZX.WebApp.TR.DatePlan" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>日计划日结果</title>
    <style type="text/css">
        .style1
        {
            text-align: center;
            font-weight: bold;
            font-size: medium;
            height: 25px;
        }
        .style3
        {
            text-align: center;
            font-weight: bold;
        }
        .style4
        {
            font-size: xx-large;
            color: #FF3300;
        }
        .style5
        {
            font-size: xx-large;
        }
        .style6
        {
            border-bottom: black 1px solid;
            border-top-style: none;
            border-right-style: none;
            border-left-style: none;
            background-color: white;
            overflow: hidden;
            height: 98%;
            width: 99%;
        }
        .style7
        {
            border-bottom: black 1px solid;
            border-top-style: none;
            border-right-style: none;
            border-left-style: none;
            background-color: white;
            overflow: hidden;
            height: 98%;
            width: 97%;
        }
    </style>
    <script language="javascript" type="text/javascript">
        //限制输入字数
        function $(id) { return document.getElementById(id) }
        function MaxText(obj, max) {
            if (obj.value.length > max) {
                alert("最多可输入" + max + "个字");
                obj.value = obj.value.substr(0, max);
            }
        }
        function BeforeSave() {
            if (CheckBeforeAdd()) {
                return true;
            }
            else
                return false;
            
        }
        function RefreshData() {
            if (parent.NeedRefreshPage != null) {
                if (typeof (parent.NeedRefreshPage.LoadData) == "function") {
                    parent.NeedRefreshPage.LoadData();
                }
            }
        }
        //检查G类工作项
        function CheckBeforeAdd() {
            var name = "";

            var content0 = $("Ta31");
            var content1 = $("Ta41");
            var checker0 = $("Ta33");
            var checker1 = $("Ta43");
            if (content0.value != "" && checker0.value == "") {
                alert("填写【工作内容】，就必须填写【检查人】");
                checker0.focus();
                return false;
            }
            else {
                name += checker0.value + ";";
            }
            if (content1.value != "" && checker1.value == "") {
                alert("填写【工作内容】，就必须填写【检查人】");
                checker1.focus();
                return false;
            }
            else {
                name += checker1.value + ";";
            }
            //判断检查人是否存在或有多个；
            var re = ZX.WebApp.TR.DatePlan.CheckUser(name).value;
            var al = "";
            var r = re.split(';');
            if (r.length > 1) {
                for (var j = 0; j < r.length; j++) {
                    if (r[j] == "")
                        continue;
                    else if (contains(r[j], "]", false)) {
                        al += r[j] + "；";
                    }
                }
            }
            if (al != "") {
                alert(al);
                return false;
            }
            else {
                var hdfsuser = $("hdf33");
                var hdfxuser = $("hdf43");
                hdfsuser.value = r[0];
                hdfxuser.value = r[1];
                return true;
            }

        }

        // string:原始字符串
        //substr:子字符串
        //isIgnoreCase:忽略大小写
        function contains(string, substr, isIgnoreCase) {
            if (isIgnoreCase) {
                string = string.toLowerCase();
                substr = substr.toLowerCase();
            }
            var startChar = substr.substring(0, 1);
            var strLen = substr.length;
            for (var j = 0; j < string.length - strLen + 1; j++) {
                if (string.charAt(j) == startChar)  //如果匹配起始字符,开始查找
                {
                    if (string.substring(j, j + strLen) == substr)  //如果从j开始的字符与str匹配，那ok
                    {
                        return true;
                    }
                }
            }
            return false;
        }

        function AlertMsg(obj) {
            if (obj == 1) {
                alert("操作成功！");
                RefreshData();
            }
            else
                alert("操作失败！");
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:HiddenField ID="hdfdpid" runat="server" />
    <asp:HiddenField ID="hdfdrid" runat="server" />
    <asp:HiddenField ID="hdfdpw1" runat="server" />
    <asp:HiddenField ID="hdfdpw2" runat="server" />
    <asp:HiddenField ID="hdfdrw1" runat="server" />
    <asp:HiddenField ID="hdfdrw2" runat="server" />
    <table id="TabWeekResult" border="1" cellpadding="0" cellspacing="0" style="width: 100%;"
        bordercolor="#FFFFFF" bordercolorlight="#000000" bgcolor="#F2F2F2" align="center">
        <tr>
            <td colspan="6">
                <table cellpadding="0" cellspacing="0" style="width: 100%; height: 50px;">
                    <tr>
                        <td align="center">
                            <font class="font6"><span style="mso-spacerun: yes" class="style5">&nbsp;</span><span
                                class="style4"><strong><asp:Label ID="LabName" runat="server" Text=""></asp:Label>
                                    &nbsp; &nbsp;&nbsp; 日结果/日计划</strong></span></font>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td style="width: 14%;" class="style1">
                日期
            </td>
            <td style="width: 8%;" class="style1">
                时间
            </td>
            <td style="width: 30%;" class="style3">
                工作内容
            </td>
            <td style="width: 30%;" class="style3">
                实际工作结果
            </td>
            <td style="width: 10%;" class="style3">
                完成情况
            </td>
            <td style="width: 8%;" class="style3">
                惩罚情况
            </td>
        </tr>
        <tr>
            <td rowspan="2" class="style1">
               <asp:Label ID="LabDateR" runat="server" Text=""></asp:Label> 日结果
            </td>
            <td class="style1">
                上午
            </td>
            <td>
                <textarea id="Ta11" readonly="readonly" rows="3" onkeypress="return MaxText(this,200);"
                    onmouseover="return MaxText(this,200);" runat="server" class="style6"></textarea>
            </td>
            <td>
                <textarea id="Ta12" rows="3" onkeypress="return MaxText(this,200);" onmouseover="return MaxText(this,200);"
                    runat="server" class="style6"></textarea>
            </td>
            <td>
                <textarea id="Ta13" rows="3" onkeypress="return MaxText(this,50);" onmouseover="return MaxText(this,50);"
                    runat="server" class="style7"></textarea>
            </td>
            <td>
                <textarea id="Ta14" rows="3" onkeypress="return MaxText(this,50);" onmouseover="return MaxText(this,50);"
                    runat="server" class="style7"></textarea>
            </td>
        </tr>
        <tr>
            <td class="style1">
                下午
            </td>
            <td>
                <textarea id="Ta21" readonly="readonly" rows="3" onkeypress="return MaxText(this,200);" onmouseover="return MaxText(this,200);"
                    runat="server" class="style6"></textarea>
            </td>
            <td>
                <textarea id="Ta22" rows="3" onkeypress="return MaxText(this,200);" onmouseover="return MaxText(this,200);"
                    runat="server" class="style6"></textarea>
            </td>
            <td>
                <textarea id="Ta23" rows="3" onkeypress="return MaxText(this,50);" onmouseover="return MaxText(this,50);"
                    runat="server" class="style7"></textarea>
            </td>
            <td>
                <textarea id="Ta24" rows="3" onkeypress="return MaxText(this,50);" onmouseover="return MaxText(this,50);"
                    runat="server" class="style7"></textarea>
            </td>
        </tr>
        <tr>
            <td class="style1">
                日期
            </td>
            <td class="style1">
                时间
            </td>
            <td class="style3">
                工作内容
            </td>
            <td class="style3">
                预期工作结果
            </td>
            <%--<td class="style3">
                检查人
            </td>--%>
            <td class="style3" colspan="2">
                自罚承诺
            </td>
        </tr>
        <tr>
            <td rowspan="2" class="style1">
               <asp:Label ID="LabDateP" runat="server" Text=""></asp:Label> 日计划
            </td>
            <td class="style1">
                上午
            </td>
            <td>
                <textarea id="Ta31" rows="3" onkeypress="return MaxText(this,200);" onmouseover="return MaxText(this,200);"
                    runat="server" class="style6"></textarea>
            </td>
            <td>
                <textarea id="Ta32" rows="3" onkeypress="return MaxText(this,200);" onmouseover="return MaxText(this,200);"
                    runat="server" class="style6"></textarea>
            </td>
            <%--<td><asp:HiddenField ID="hdf33" runat="server" />
                <textarea id="Ta33" rows="3" onkeypress="return MaxText(this,50);" onmouseover="return MaxText(this,50);"
                    runat="server" class="style7"></textarea>
            </td>--%>
            <td colspan="2">
                <textarea id="Ta34" rows="3" onkeypress="return MaxText(this,50);" onmouseover="return MaxText(this,50);"
                    runat="server" class="style7"></textarea>
            </td>
        </tr>
        <tr>
            <td class="style1">
                下午
            </td>
            <td>
                <textarea id="Ta41" rows="3" onkeypress="return MaxText(this,200);" onmouseover="return MaxText(this,200);"
                    runat="server" class="style6"></textarea>
            </td>
            <td>
                <textarea id="Ta42" rows="3" onkeypress="return MaxText(this,200);" onmouseover="return MaxText(this,200);"
                    runat="server" class="style6"></textarea>
            </td>
            <%--<td><asp:HiddenField ID="hdf43" runat="server" />
                <textarea id="Ta43" rows="3" onkeypress="return MaxText(this,50);" onmouseover="return MaxText(this,50);"
                    runat="server" class="style7"></textarea>
            </td>--%>
            <td colspan="2">
                <textarea id="Ta44" rows="3" onkeypress="return MaxText(this,50);" onmouseover="return MaxText(this,50);"
                    runat="server" class="style7"></textarea>
            </td>
        </tr>
        <tr>
            <td rowspan="2" class="style1">
                当日总结
            </td>
            <td class="style1">
                分享
            </td>
            <td colspan="4">
                <textarea id="TaDateShare" rows="3" onkeypress="return MaxText(this,200);" onmouseover="return MaxText(this,200);"
                    runat="server" class="style6"></textarea>
            </td>
        </tr>
        <tr>
            <td class="style1">
                改进措施
            </td>
            <td colspan="4">
                <textarea id="TaWarpMend" rows="3" onkeypress="return MaxText(this,200);" onmouseover="return MaxText(this,200);"
                    runat="server" class="style6"></textarea>
            </td>
        </tr>
        <tr>
            <td colspan="2" class="style1">
                自我激励
            </td>
            <td colspan="4">
                <textarea id="TaSelfUp" rows="3" onkeypress="return MaxText(this,200);" onmouseover="return MaxText(this,200);"
                    runat="server" class="style6"></textarea>
            </td>
        </tr>
        <tr>
            <td colspan="2" class="style1">
                现在焦点
            </td>
            <td colspan="3">
                <textarea id="TaNowPoint" rows="3" onkeypress="return MaxText(this,200);" onmouseover="return MaxText(this,200);"
                    runat="server" class="style6"></textarea>
            </td>
            <td>
                <asp:ImageButton ID="IbtnSave" ImageUrl="~/Images/Peixun/save.bmp"
                    OnClick="IbtnSave_OnClick" runat="server" />
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
